package cn.qw.springcache.controller;

import cn.qw.springcache.pojo.Department;
import cn.qw.springcache.pojo.Employee;
import cn.qw.springcache.service.DepartmentService;
import cn.qw.springcache.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DepartmentController {

    @Autowired
    private DepartmentService service;

    @GetMapping("/dep/{id}")
    public Department get(@PathVariable("id") Integer id) {
        return service.selectByPrimaryKey(id);
    }
}
